Skip to content

HDDS-15533. DNS refresh on heartbeat failure for DN to SCM#10844

Open
kerneltime wants to merge 1 commit into
apache:masterfrom
kerneltime:HDDS-15533-dn-scm-refresh
Open

HDDS-15533. DNS refresh on heartbeat failure for DN to SCM#10844
kerneltime wants to merge 1 commit into
apache:masterfrom
kerneltime:HDDS-15533-dn-scm-refresh

Conversation

@kerneltime

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Adds DNS refresh on the DN→SCM heartbeat path, completing the // TODO: HDDS-15533 left in HostAndPort by HDDS-15682 (#10612).

#10612 keys SCM-node identity on the stable configured host:port, but it resolves the address once and freezes it — so a datanode keeps dialing a dead IP after an SCM pod is rescheduled to a new IP. This change:

  • Makes HostAndPort.address threadsafe (volatile) and adds refresh() to re-resolve host:port and swap the cached address on an IP change (resolving the TODO).
  • Adds SCMConnectionManager.refreshSCMServer(), which rebuilds the endpoint under the same host:port key and closes the stale proxy. Because the key is stable, there is no re-keying, collision check, or StateContext queue migration.
  • HeartbeatEndpointTask triggers the refresh on a connection-class heartbeat failure once the missed-heartbeat threshold is reached, gated by the existing ozone.client.failover.resolve-needed flag.

New config: hdds.heartbeat.address.refresh.threshold (default 3). Off by default — with ozone.client.failover.resolve-needed=false (the default) behaviour is unchanged.

This replaces the earlier stacked attempt (szetszwo#11), rebuilt directly on master now that #10612 has merged; it also supersedes the closed #10488.

What is the link to the Apache JIRA?

https://issues.apache.org/jira/browse/HDDS-15533

How was this patch tested?

New TestHeartbeatEndpointTaskDnsRefresh verifies a connection-class failure past the threshold triggers the refresh, and that flag-off, application-level errors, and below-threshold do not. mvn checkstyle:check passes on hadoop-hdds/common and hadoop-hdds/container-service. Full module build/tests were not run locally; relying on CI.

Generated-by: Claude Code (Opus 4.8)

Resolves the HDDS-15682 TODO in HostAndPort: makes the cached address threadsafe (volatile) and adds
refresh() to re-resolve host:port on demand. On a connection-class heartbeat failure past a threshold
(gated by ozone.client.failover.resolve-needed), HeartbeatEndpointTask asks
SCMConnectionManager.refreshSCMServer to re-resolve the SCM peer and, on an IP change, rebuild the
endpoint under the same host:port key. The stable key means no re-keying or StateContext queue
migration is needed.

New knob: hdds.heartbeat.address.refresh.threshold (default 3).

Generated-by: Claude Code (Opus 4.8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant